<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link type="text/css" rel="stylesheet" href="css/company.css"/>
    <script type="text/javascript" src="js/jquery-1.12.4.min.js"></script>
    <script type="text/javascript" src="js/company.js"></script>
    <title>职位信息</title>
</head>

<body>
<div class="compHeader">
    <div class="main">
        <div class="header_l">
            <a href="index.jsp">
                <img src="images/logo_1.png"/>
                <img src="images/logo_2.png"/>
            </a>
            <span>www.xxx.com</span>
        </div>
        <div class="header_c">
            <input name="" type="text" placeholder="请输入关键字..." class="keyword"/>
            <input name="" type="button" class="btnsearch"/>
        </div>
        <div class="header_r">
            <a href="login.jsp">个人登录</a>
            <a href="register.jsp">注册</a>
        </div>
    </div>
</div>

<div class="jobtypeBox">
    <div class="DivLeft">
        <div class="DivCompany">
            <div class="DivCompany_img"><img src="images/company.gif" width="180"/></div>
            <h1>
                <a href="company.do?eid=${userJobEnterprise.job.enterprise.eid}">${userJobEnterprise.job.enterprise.ename}</a><img
                    src="images/16.png"/></h1>
            <div class="clear"></div>
            <div class="DivLeft_2">
                <p>行业：${userJobEnterprise.job.enterprise.etype}</p>
                <p>性质：${userJobEnterprise.job.enterprise.edomain}</p>
                <p>规模：${userJobEnterprise.job.enterprise.escale}</p>
                <p>企业主页：<a href="">${userJobEnterprise.job.enterprise.ewebsite}</a></p>
                <p>详细地址：${userJobEnterprise.job.enterprise.eaddress}</p>
                <p>${userJobEnterprise.job.enterprise.eprofile}
                    <%--
                    广州市***信息技术有限公司是专业生产教学仪器设备和办公设备的企业，致力于计算机网络工程、电化教学设备、实验室成套设备及实验器材、多功能会议系统及智能公共广播系统、办公自动化、楼宇自动化（智能大厦/小区）、数字网络监控及防盗报警系统、体育用品的设计及集成，提供相关方面的技术咨询和服务。--%></p>
            </div>
            <div class="clear"></div>
        </div>
    </div>
    <div class="DivRight">
        <div class="DivRight_2">
            <div id="jobinfodiv" class="divJob_1">
                <div class="divJob_l">
                    <div class="tit">
                        <h2>${userJobEnterprise.job.jname}</h2>
                        <div class="clear"></div>
                    </div>
                    <div class="bqbox">
                        <label>年终奖</label>
                        <label>节日福利</label>
                        <label>双休</label>
                        <label>8小时工作制</label>
                        <label>带薪年假</label>
                        <label>交通补贴</label>
                        <div class="clear"></div>
                    </div>
                    <div class="jobsub">工作地点： ${userJobEnterprise.job.jplace}</div>
                    <div class="jobsub">职位月薪： ${userJobEnterprise.job.jmonthsalary}</div>
                    <div class="jobsub">招聘人数： ${userJobEnterprise.job.jrecruitsbumber}</div>
                    <div class="jobsub">最低学历： ${userJobEnterprise.job.jmineducation}</div>
                    <div class="jobsub">年龄要求： ${userJobEnterprise.job.jagerequirement}</div>
                    <div class="jobsub">工作经验： ${userJobEnterprise.job.jexperience}</div>
                    <div class="jobsub">招聘方式： ${userJobEnterprise.job.jrecruitmentmethod}</div>
                    <div class="jobsub">刷新日期： ${userJobEnterprise.job.jrefreshdate}</div>
                </div>
            </div>
            <div class="clear"></div>
            <div class="divJob_2">
                <div id="ApplicationPrompt" class="divJob_2_1">
                    立即申请
                </div>
            </div>
            <div class="clear"></div>
            <div class="divJob_3">
                <b>岗位职责：</b><br/>
                <div id="Jobresponsibility" class="con">
                    <pre>${userJobEnterprise.job.jresponsibility}</pre>
                </div>
                <b>岗位要求：</b><br/>
                <div class="con">
                    <pre>${userJobEnterprise.job.jrequirements}</pre>
                </div>
            </div>
            <div class="clear"></div>
        </div>
    </div>
</div>

<div class="clear"></div>
<div class="footer">
</div>
</body>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script>
    $(document).ready(function () {

        if ("${userJobEnterprise.jobuserstatus}" == "1") {
            $("#ApplicationPrompt").text("已申请")
            $("#ApplicationPrompt").css("background", "rgb(153,153,170)")
        } else {
            $("#ApplicationPrompt").html("立即申请")
            $("#ApplicationPrompt").css("background-color", "#F96B2D");
        }

        $("#ApplicationPrompt").click(function () {
            if ("${user.uid}" != "") {
                $.get("queryUserJobEnterprise.do",
                    {
                        "uid": "${user.uid}",
                        "eid": "${userJobEnterprise.job.enterprise.eid}",
                        "jid": "${userJobEnterprise.job.jid}"
                    },
                    function (obj) {
                        eval("var str=" + obj)
                        if (str == null) {
                            $.get("addUserJobEnterprisewithUser.do",
                                {
                                    "uid": "${user.uid}",
                                    "eid": "${userJobEnterprise.job.enterprise.eid}",
                                    "jid": "${userJobEnterprise.job.jid}",
                                    "jobuserstatus": 1
                                }, function (i) {
                                    if (i == 1) {
                                        $("#ApplicationPrompt").text("已申请")
                                        window.location.reload();
                                    }
                                })
                        } else {
                            if (str.jobuserstatus == null || str.jobuserstatus == 0) {
                                $.get("modifyUserJobEnterprise.do",
                                    {
                                        "uid": "${user.uid}",
                                        "eid": "${userJobEnterprise.job.enterprise.eid}",
                                        "jid": "${userJobEnterprise.job.jid}",
                                        "jobuserstatus": 1
                                    },
                                    function (i) {
                                        if (i == 1) {
                                            $("#ApplicationPrompt").text("已申请")
                                            window.location.reload();
                                        }

                                    });
                            } else if (str.jobuserstatus == 1) {
                                $.get("modifyUserJobEnterprise.do",
                                    {
                                        "uid": "${user.uid}",
                                        "eid": "${userJobEnterprise.job.enterprise.eid}",
                                        "jid": "${userJobEnterprise.job.jid}",
                                        "jobuserstatus": 0
                                    },
                                    function (i) {
                                        if (i == 1) {
                                            $("#ApplicationPrompt").text("立即申请")
                                            window.location.reload();

                                        }
                                    })
                            }
                        }
                    })
            } else {
                var b = window.confirm("您还没有登录，请登录");
                if (b) {
                    window.location.replace("index.jsp")
                }
            }
        })
    })
</script>
</html>
